<template>
  <div>
    <header>
      <div>
        <span @click="Return" class="jiantou"></span>
        <p>账户信息</p>
      </div>
    </header>
     <!-- v-for="(value, index) in arr" :key="index" -->
    <main>
      <div class="separatrix"></div>
      <!-- 头像盒子 -->
      <div class="png">
        <input
          ref="tupian"
          type="file"
          placeholder=""
          @change="reviseSrc($event)"
        />
        <span> 头像 </span>
        <p>
          <img class="icon" :src="src" alt="" />
          <svg
            t="1631526667316"
            class="jianttouu"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2159"
            width="200"
            height="200"
          >
            <path
              d="M346.52382345477406 104.43830532674417c-12.257495055447652-12.257495055447652-30.6437359627898-12.257495055447652-42.90123101823747 0s-12.257495055447652 30.6437359627898 0 42.90123101823747L668.2830560915551 512 303.6225924365366 876.6604636550185c-12.257495055447652 12.257495055447652-12.257495055447652 30.6437359627898 0 42.90123101823747 6.128747527723826 6.128747527723826 15.3218679813949 9.193120453671073 21.450615509118734 9.193120453671073s15.3218679813949-3.064372925947246 21.450615509118734-9.193120453671073l386.1110791641372-386.1110791641372c12.257495055447652-12.257495055447652 12.257495055447652-30.6437359627898 0-42.90123101823747L346.52382345477406 104.43830532674417z"
              fill="#cdcdcd"
              p-id="2160"
            ></path>
          </svg>
        </p>
      </div>
      <div class="xinxi">
        <span>用户名</span>
        <p>
          {{ arr.username
          }}<svg
            t="1631526667316"
            class="jianttouu"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2159"
            width="200"
            height="200"
          >
            <path
              d="M346.52382345477406 104.43830532674417c-12.257495055447652-12.257495055447652-30.6437359627898-12.257495055447652-42.90123101823747 0s-12.257495055447652 30.6437359627898 0 42.90123101823747L668.2830560915551 512 303.6225924365366 876.6604636550185c-12.257495055447652 12.257495055447652-12.257495055447652 30.6437359627898 0 42.90123101823747 6.128747527723826 6.128747527723826 15.3218679813949 9.193120453671073 21.450615509118734 9.193120453671073s15.3218679813949-3.064372925947246 21.450615509118734-9.193120453671073l386.1110791641372-386.1110791641372c12.257495055447652-12.257495055447652 12.257495055447652-30.6437359627898 0-42.90123101823747L346.52382345477406 104.43830532674417z"
              fill="#cdcdcd"
              p-id="2160"
            ></path>
          </svg>
        </p>
      </div>
      <div class="xinxi">
        <span>收货地址</span>
        <p>
          <svg
            t="1631526667316"
            class="jianttouu"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2159"
            width="200"
            height="200"
          >
            <path
              d="M346.52382345477406 104.43830532674417c-12.257495055447652-12.257495055447652-30.6437359627898-12.257495055447652-42.90123101823747 0s-12.257495055447652 30.6437359627898 0 42.90123101823747L668.2830560915551 512 303.6225924365366 876.6604636550185c-12.257495055447652 12.257495055447652-12.257495055447652 30.6437359627898 0 42.90123101823747 6.128747527723826 6.128747527723826 15.3218679813949 9.193120453671073 21.450615509118734 9.193120453671073s15.3218679813949-3.064372925947246 21.450615509118734-9.193120453671073l386.1110791641372-386.1110791641372c12.257495055447652-12.257495055447652 12.257495055447652-30.6437359627898 0-42.90123101823747L346.52382345477406 104.43830532674417z"
              fill="#cdcdcd"
              p-id="2160"
            ></path>
          </svg>
        </p>
      </div>
      <div class="separatrix te">账号绑定</div>
      <div class="xinxi">
        <span>手机</span>
        <p>
          <svg
            t="1631526667316"
            class="jianttouu"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2159"
            width="200"
            height="200"
          >
            <path
              d="M346.52382345477406 104.43830532674417c-12.257495055447652-12.257495055447652-30.6437359627898-12.257495055447652-42.90123101823747 0s-12.257495055447652 30.6437359627898 0 42.90123101823747L668.2830560915551 512 303.6225924365366 876.6604636550185c-12.257495055447652 12.257495055447652-12.257495055447652 30.6437359627898 0 42.90123101823747 6.128747527723826 6.128747527723826 15.3218679813949 9.193120453671073 21.450615509118734 9.193120453671073s15.3218679813949-3.064372925947246 21.450615509118734-9.193120453671073l386.1110791641372-386.1110791641372c12.257495055447652-12.257495055447652 12.257495055447652-30.6437359627898 0-42.90123101823747L346.52382345477406 104.43830532674417z"
              fill="#cdcdcd"
              p-id="2160"
            ></path>
          </svg>
        </p>
      </div>
      <div class="separatrix te">安全设置</div>
      <div class="xinxi" @click="Revise">
        <span>登陆密码</span>
        <p>修改</p>
      </div>
      <button>退出登录</button>
    </main>
  </div>
</template>
<style scoped>
.png input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0 solid #000;
  opacity: 0;
}
button {
  width: 90%;
  margin-left: 5%;
  height: 0.7rem;
  text-align: center;
  line-height: 0.7rem;
  border-radius: 6px;
  margin-top: 0.6rem;
  color: #fff;
  background: #d8584a;
}
.png p {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.xinxi p {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.jianttouu {
  width: 0.3rem;
  height: 0.3rem;
  vertical-align: middle;
}
.te {
  height: 0.6rem !important;
  line-height: 0.6rem;
  padding-left: 0.4rem;
  box-sizing: border-box;
}
.xinxi {
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 0rem 0.4rem;
  border-bottom: 1px solid #ddd;
}
.png {
  position: relative;
  width: 100%;
  height: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.4rem;
  box-sizing: border-box;
  border-bottom: 1px solid #ddd;
}
.icon {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
}
.separatrix {
  height: 0.3rem;
  width: 100%;
  background-color: #f5f5f5;
}
main {
  margin-top: 1rem;
}
* {
  margin: 0;
  padding: 0;
  font-size: 0.3rem;
}
header {
  position: fixed;
  z-index: 1990;
  top: 0;
  left: 0;
  width: 100%;
  height: 1rem;
  background-color: #3190e8;
}
header div {
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  font-size: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 60%;
  height: 1rem;
  color: #fff;
  box-sizing: border-box;
  font-weight: 700;
}
.jiantou {
  width: 0.24rem;
  height: 0.24rem;
  fill: #fff;
  border: 1px solid #fff;
  border-width: 0.06rem 0.06rem 0px 0px;
  transform: rotateZ(225deg);
}
</style>
<script>
export default {
  data() {
    return {
      arr: [],
      //   src: "http://elm.cangdu.org/img/",
      src: "http://elm.cangdu.org/img/default.jpg",
    };
  },
  methods: {
    /* 返回 */
    Return() {
      this.$router.go(-1);
    },
    /* 修改密码 */
    Revise() {
      this.$router.push("/elm-revisepwd");
    },
    /* 更换图片 */
    reviseSrc(e) {
      var file = e.target.files[0];
      var reader = new FileReader();
      var that = this;
      reader.readAsDataURL(file);
      reader.onload = function (e) {
        that.src = this.result;
        localStorage.src = this.result;
      };
      //   this.src = this.img;
    //   console.log(this.src);
    },
  },
  mounted() {
    if (localStorage.src) {
      this.src = localStorage.src;
    }
    if (localStorage.submit) {
      // console.log( localStorage.sumbit);
      this.arr = JSON.parse(localStorage.submit);
      // console.log(this.arr);
    } else {
      this.arr.push(this.$route.query.arr1);
      if (this.$route.query.arr1) {
        localStorage.submit = JSON.stringify(this.arr);
        // console.log(this.arr);
      }
    }
    // console.log(this.arr);
  },
};
</script>
